//
//  HRMyPreferentTableViewCell.m
//  haierapp
//
//  Created by Xia Zhiyong on 14-8-11.
//  Copyright (c) 2014年 haier. All rights reserved.
//

#import "HRMyPreferentTableViewCell.h"
#import "HRCouponInfoModel.h"

@implementation HRMyPreferentTableViewCell

- (void)awakeFromNib
{
    // Initialization code
}

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = (HRMyPreferentTableViewCell *)[[[NSBundle mainBundle] loadNibNamed:@"HRMyPreferentTableViewCell"
                                                                         owner:self
                                                                       options:nil] objectAtIndex:0];
    return self;
}

-(void)configWithData:(id)data canUse:(BOOL)canUse{
    HRCouponInfoModel *info = (HRCouponInfoModel*)data;
    _btnBg.enabled = canUse;
    _lblAmount.text = [NSString stringWithFormat:@"¥%@0",info.amount];
    _lblAmount.adjustsFontSizeToFitWidth = YES;
    _lblServiceRestrictions.text = [NSString stringWithFormat:@"订单满%@元立减%@元",info.serviceRestrictions,info.amount];
    _lblServiceRestrictions.adjustsFontSizeToFitWidth= YES;
    _lblEnd.text = [NSString stringWithFormat:@"%@",info.lifeTime];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
}

@end
